package com.example.springbootsfzy.service.liujinping;

import com.example.springbootsfzy.domain.CourseCommunications;
import com.example.springbootsfzy.mapper.CourseCommunicationsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseCommunicationsService {
    //课程交流
    @Autowired
    private CourseCommunicationsMapper courseCommunicationsMapper;
    public int  addCourseCommunications(CourseCommunications courseCommunications) {
       return courseCommunicationsMapper.insert(courseCommunications);

    }
    public CourseCommunications getCourseCommunications(Long id) {
        return courseCommunicationsMapper.selectByPrimaryKey(id);
    }
    public List<CourseCommunications> getAllCourseCommunications() {
        return courseCommunicationsMapper.getAllCourseCommunications();
    }
    public int  updateCourseCommunications(CourseCommunications courseCommunications) {
        return courseCommunicationsMapper.updateByPrimaryKey(courseCommunications);
    }
    public int  updateCourseCommunicationsActiv(CourseCommunications courseCommunications) {
        return courseCommunicationsMapper.updateByPrimaryKeySelective(courseCommunications);
    }
    public int  deleteCourseCommunications(Long id) {
        return courseCommunicationsMapper.deleteByPrimaryKey(id);
    }

    public List<CourseCommunications> getCourseCommunicationsAllInfoByID(Integer id) {
        return courseCommunicationsMapper.getCourseCommunicationsAllInfoByID(id);
    }
}
